
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>数据类型及判断 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="闭包.html" />
    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Js基础部分</li>
        
        
    
        <li class="chapter active" data-level="2.1" data-path="数据类型及判断.html">
            
                <a href="数据类型及判断.html">
            
                    
                    数据类型及判断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="闭包.html">
            
                <a href="闭包.html">
            
                    
                    闭包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="作用域.html">
            
                <a href="作用域.html">
            
                    
                    作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="函数提升、变量提升.html">
            
                <a href="函数提升、变量提升.html">
            
                    
                    函数提升、变量提升
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="原型链.html">
            
                <a href="原型链.html">
            
                    
                    原型链
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="js继承.html">
            
                <a href="js继承.html">
            
                    
                    js继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="深拷贝、浅拷贝.html">
            
                <a href="深拷贝、浅拷贝.html">
            
                    
                    深拷贝、浅拷贝
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="let、const、var区别.md">
            
                <span>
            
                    
                    let、const、var区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="async、await.md">
            
                <span>
            
                    
                    async、await
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="模块化.md">
            
                <span>
            
                    
                    模块化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="this指向问题.md">
            
                <span>
            
                    
                    this指向问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="算法.md">
            
                <span>
            
                    
                    算法
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Js高级部分</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../js高级/垃圾回收机制、内存泄漏.md">
            
                <span>
            
                    
                    垃圾回收机制、内存泄漏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../js高级/事件机制、js事件绑定.md">
            
                <span>
            
                    
                    事件机制、js事件绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../js高级/事件循环.md">
            
                <span>
            
                    
                    事件循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../js高级/Promise.md">
            
                <span>
            
                    
                    Promise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="../js高级/class.md">
            
                <span>
            
                    
                    class
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="../js高级/同步、异步.html">
            
                <a href="../js高级/同步、异步.html">
            
                    
                    同步、异步
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">计算机基础</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../计算机基础/进程、线程、cpu、内存.md">
            
                <span>
            
                    
                    进程、线程、cpu、内存
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">游览器</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../游览器/游览器渲染机制、输入url,游览器执行过程.md">
            
                <span>
            
                    
                    游览器渲染机制、输入url,游览器执行过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../游览器/游览器缓存机制.md">
            
                <span>
            
                    
                    游览器缓存机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../游览器/同源策略、跨域解决问题.md">
            
                <span>
            
                    
                    同源策略、跨域解决问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="../游览器/ajax原理，es6写法.md">
            
                <span>
            
                    
                    ajax原理，es6写法
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">框架</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../框架/生命周期、钩子函数.md">
            
                <span>
            
                    
                    生命周期、钩子函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../框架/虚拟DOM、diff算法.md">
            
                <span>
            
                    
                    虚拟DOM、diff算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="../框架/组件通信.md">
            
                <span>
            
                    
                    组件通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="../框架/状态管理.md">
            
                <span>
            
                    
                    状态管理
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">webpack</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="../webpack/webpack原理、常用loader.md">
            
                <span>
            
                    
                    webpack原理、常用loader
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">http</li>
        
        
    
        <li class="chapter " data-level="8.1" data-path="../http/报文结构、区别.md">
            
                <span>
            
                    
                    报文结构、区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="../http/网络攻击.md">
            
                <span>
            
                    
                    网络攻击
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">常见问题</li>
        
        
    
        <li class="chapter " data-level="9.1" data-path="../数组去重.md">
            
                <span>
            
                    
                    数组去重
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="../防抖节流.md">
            
                <span>
            
                    
                    防抖节流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="../手写promise.md">
            
                <span>
            
                    
                    手写promise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.4" data-path="../类型判读、深浅拷贝.md">
            
                <span>
            
                    
                    类型判读、深浅拷贝
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.5" >
            
                <a target="_blank" href="https://juejin.cn/post/7030981812880932878">
            
                    
                    https://juejin.cn/post/7030981812880932878
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.6" >
            
                <a target="_blank" href="https://juejin.cn/post/6945625394154307592#heading-2">
            
                    
                    https://juejin.cn/post/6945625394154307592#heading-2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.7" >
            
                <a target="_blank" href="https://juejin.cn/user/3984285872165176/posts">
            
                    
                    https://juejin.cn/user/3984285872165176/posts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.8" data-path="../常用方法封装.html">
            
                <a href="../常用方法封装.html">
            
                    
                    常用方法封装
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">前端资料</li>
        
        
    
        <li class="chapter " data-level="10.1" >
            
                <a target="_blank" href="https://underscorejs.org/">
            
                    
                    https://underscorejs.org/
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >数据类型及判断</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6570;&#x636E;&#x7C7B;&#x578B;&#x53CA;&#x5224;&#x65AD;">&#x6570;&#x636E;&#x7C7B;&#x578B;&#x53CA;&#x5224;&#x65AD;</h1>
<ul>
<li>&#x6570;&#x636E;&#x7C7B;&#x578B;</li>
<li>&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4E4B;&#x95F4;&#x7684;&#x533A;&#x522B;</li>
<li>&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x5224;&#x65AD;</li>
</ul>
<h3 id="&#x6570;&#x636E;&#x7C7B;&#x578B;">&#x6570;&#x636E;&#x7C7B;&#x578B;</h3>
<p>&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5206;&#x4E3A;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3001;&#x5F15;&#x7528;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x5982;&#x4E0B;&#xFF1A;</p>
<ul>
<li><p>&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;</p>
<ul>
<li><p>Number</p>
<p>&#x6240;&#x6709;&#x7684;&#x6570;&#x5B57;&#xFF08;&#x5305;&#x62EC;&#x6D6E;&#x70B9;&#x6570;&#xFF09;&#x3001;NaN&#x90FD;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#xFF1A;</p>
<ul>
<li><p>Number()</p>
<p>&#x5C06;&#x975E;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x8F6C;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#xFF0C;&#x4E0D;&#x80FD;&#x8F6C;&#x6362;&#x4E3A;NaN&#x3002;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3001;null&#x3001;&quot;&quot;&#x3001;[]&#x3001;&#x6570;&#x7EC4;&#x4E2D;&#x6709;&#x4E00;&#x9879;&#x4E14;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x6216;&#x5B57;&#x7B26;&#x4E32;&#x6570;&#x5B57;&#x53EF;&#x4EE5;&#x8F6C;&#x6362;&#xFF0C;&#x5176;&#x4F59;&#x4E3A;NaN&#x3002;</p>
</li>
<li><p>parseInt()</p>
<p>&#x4ECE;&#x5DE6;&#x5230;&#x53F3;&#x4F9D;&#x6B21;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x9047;&#x5230;&#x4E0D;&#x80FD;&#x8F6C;&#x6362;&#x5B57;&#x7B26;&#x65F6;&#x9000;&#x51FA;&#xFF0C;&#x8FD4;&#x56DE;&#x5DF2;&#x8F6C;&#x6362;&#x6570;&#x503C;&#x3002;</p>
</li>
<li><p>parseFloat()</p>
<p>&#x4ECE;&#x5DE6;&#x5230;&#x53F3;&#x4F9D;&#x6B21;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x9047;&#x5230;&#x4E0D;&#x80FD;&#x8F6C;&#x6362;&#x5B57;&#x7B26;&#x65F6;&#x9000;&#x51FA;&#xFF0C;&#x4E0D;&#x652F;&#x6301;&#x7B2C;&#x4E8C;&#x4E2A;&#x5C0F;&#x6570;&#x70B9;&#xFF0C;&#x8FD4;&#x56DE;&#x8F6C;&#x6362;&#x503C;&#x3002;</p>
</li>
<li><p>isNaN()</p>
<p>&#x9A8C;&#x8BC1;&#x5F53;&#x524D;&#x53D8;&#x91CF;&#x662F;&#x5426;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#xFF0C;&#x9047;&#x5230;&#x4E0D;&#x8BC6;&#x522B;&#x7C7B;&#x578B;&#x5148;&#x7528;Number()&#x8F6C;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#xFF0C;&#x5982;&#x679C;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x4E3A;false&#x3001;&#x5176;&#x4F59;&#x4E3A;NaN&#x3002;</p>
</li>
</ul>
</li>
<li><p>String</p>
<p>&#x6240;&#x6709;&#x7528;&#x5355;&#x5F15;&#x53F7;&#x6216;&#x53CC;&#x5F15;&#x53F7;&#x5305;&#x88F9;&#x7684;&#x90FD;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#xFF1A;</p>
<ul>
<li><p>String()</p>
<p>&#x5C06;&#x975E;&#x5B57;&#x7B26;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x3002;&#x5F53;&#x8F6C;&#x6362;&#x503C;&#x4E3A;object&#x7C7B;&#x578B;&#x65F6;&#x8F6C;&#x4E3A;&apos;[object Object]&apos;&#x3002;</p>
</li>
<li><p>charAt()</p>
<p>&#x67E5;&#x627E;&#x5B57;&#x7B26;&#x6240;&#x5728;&#x7D22;&#x5F15;&#x3002;</p>
</li>
<li><p>indexOf()</p>
<p>&#x5224;&#x65AD;&#x5B57;&#x7B26;&#x662F;&#x5426;&#x5728;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x8FD4;&#x56DE;&#x9996;&#x5B57;&#x7B26;&#x7D22;&#x5F15;&#xFF0C;&#x6CA1;&#x6709;&#x8FD4;&#x56DE;-1&#x3002;</p>
</li>
<li><p>split()</p>
<p>&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x7528;&#x67D0;&#x4E2A;&#x7B26;&#x53F7;&#x5206;&#x9694;&#x7EC4;&#x6210;&#x6570;&#x7EC4;&#x3002;</p>
</li>
<li><p>toUpperCase/toLoweCase</p>
<p>&#x5B57;&#x7B26;&#x4E32;&#x5927;&#x5C0F;&#x8F6C;&#x6362;&#x3002;</p>
</li>
<li><p>stustr/substring/slice</p>
<p>stustr &#x4ECE;&#x7D22;&#x5F15;n&#x5F00;&#x59CB;&#x622A;&#x53D6;m&#x4E2A;&#x5B57;&#x7B26;&#x3002;</p>
<p>substring &#x4ECE;&#x7D22;&#x5F15;n&#x5F00;&#x59CB;&#x622A;&#x53D6;m&#x4E2A;&#x5B57;&#x7B26;&#x4E0D;&#x5305;&#x62EC;m&#x3002;</p>
<p>slice &#x540C;&#x4E0A;</p>
</li>
<li><p>replace/replaceAll</p>
<p>&#x5B9E;&#x73B0;&#x5B57;&#x7B26;&#x4E32;&#x66FF;&#x6362;&#xFF0C;replace&#x5982;&#x679C;&#x6709;&#x591A;&#x4E2A;&#x5B57;&#x7B26;&#x66FF;&#x6362;&#x53EA;&#x4F1A;&#x66FF;&#x6362;&#x7B2C;&#x4E00;&#x4E2A;&#xFF0C;replaceAll&#x5168;&#x90E8;&#x66FF;&#x6362;&#x3002;</p>
</li>
</ul>
</li>
<li><p>Boolean</p>
<p>&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#x53EA;&#x6709;true/false</p>
<p>&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#xFF1A;</p>
<ul>
<li><p>Boolean()</p>
<p>&#x5C06;&#x975E;&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x4E3A;&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#xFF0C;false&#x3001;null&#x3001;&quot;&quot;&#x3001;0&#x3001;undefined&#x8F6C;&#x4E3A;false&#xFF0C;&#x5176;&#x4F59;&#x4E3A;true&#x3002;</p>
</li>
</ul>
</li>
<li><p>null</p>
<p>&#x58F0;&#x660E;&#x672A;&#x8D4B;&#x503C;</p>
</li>
<li><p>undefined</p>
<p>&#x672A;&#x5B9A;&#x4E49;</p>
</li>
</ul>
</li>
<li><p>&#x5F15;&#x7528;&#x6570;&#x636E;&#x7C7B;&#x578B;</p>
<ul>
<li><p>Object</p>
<p>&#x7531;&#x952E;&#x503C;&#x5BF9;&#x7EC4;&#x5408;&#x800C;&#x6210;&#x7684;&#x65E0;&#x5E8F;&#x96C6;&#x5408;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;</p>
<ul>
<li>obj.xxx == obj[xxx]</li>
<li>obj[111] == obj[&apos;111&apos;]</li>
<li>obj[{name: &apos;1&apos;}] == obj[object Object] &#x5982;&#x679C;&#x5BF9;&#x8C61;&#x5C5E;&#x6027;&#x540D;&#x4E3A;&#x975E;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x90FD;&#x662F;[object.Object]</li>
</ul>
</li>
<li><p>Array</p>
<p>&#x7531;&#x7D22;&#x5F15;&#x3001;&#x503C;&#x7EC4;&#x6210;&#x7684;&#x6709;&#x5E8F;&#x96C6;&#x5408;&#x3002;</p>
</li>
<li><p>&#x6B63;&#x5219;</p>
</li>
<li><p>Math</p>
</li>
<li><p>Date</p>
</li>
<li><p>Function</p>
</li>
</ul>
</li>
</ul>
<h3 id="&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4E0E;&#x5F15;&#x7528;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x533A;&#x522B;&#xFF1A;">&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4E0E;&#x5F15;&#x7528;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x533A;&#x522B;&#xFF1A;</h3>
<p>js&#x4E2D;&#x6240;&#x6709;&#x7684;&#x53D8;&#x91CF;&#x90FD;&#x662F;&#x5B58;&#x50A8;&#x5230;&#x6808;&#x5185;&#x5B58;&#x4E2D;&#x3002;</p>
<ul>
<li>&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5728;&#x4F20;&#x53C2;&#x65F6;&#x662F;&#x503C;&#x4F20;&#x9012;&#xFF0C;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x662F;&#x5730;&#x5740;&#x4F20;&#x9012;&#x3002;</li>
<li>&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5B58;&#x50A8;&#x5728;&#x6808;&#x5185;&#x5B58;&#x7684;&#x503C;&#x5B58;&#x50A8;&#x533A;&#x57DF;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x4F1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5806;&#x5185;&#x5B58;&#x3002;</li>
</ul>
<h3 id="&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5224;&#x65AD;">&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5224;&#x65AD;</h3>
<ul>
<li><p>typeof</p>
<p>typeof&#x8FD4;&#x56DE;&#x5FC5;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#xFF0C;&#x4E00;&#x822C;&#x7528;&#x6765;&#x68C0;&#x6D4B;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;</p>
<ul>
<li>NaN&#x4E3A;&quot;number&quot;&#x3001;null&#x4E3A;&quot;object&quot;&#x3001;function&#x4E3A;&quot;function&quot;</li>
<li>&#x6682;&#x65F6;&#x6027;&#x6B7B;&#x533A;</li>
</ul>
</li>
<li><p>instanceof</p>
<p>&#x5224;&#x65AD;&#x5B9E;&#x4F8B;&#x662F;&#x4E0D;&#x662F;&#x5C5E;&#x4E8E;&#x5F53;&#x524D;&#x7C7B;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;</p>
<ul>
<li>&#x666E;&#x901A;&#x521B;&#x5EFA;&#x7684;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x65E0;&#x6CD5;&#x4F7F;&#x7528;&#xFF0C;&#x901A;&#x8FC7;&#x6784;&#x9020;&#x65B9;&#x5F0F;&#x521B;&#x5EFA;&#x7684;&#x57FA;&#x672C;&#x7C7B;&#x578B;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8BE5;&#x65B9;&#x6CD5;&#x5224;&#x65AD;&#x3002;</li>
</ul>
</li>
<li><p>constructor</p>
<p>&#x5224;&#x65AD;&#x5B9E;&#x4F8B;&#x7684;constructor&#x662F;&#x5426;&#x5C5E;&#x4E8E;&#x8FD9;&#x4E2A;&#x7C7B;</p>
<p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;</p>
<ul>
<li>null&#x548C;undefined&#x6CA1;&#x6709;constructor&#x5C5E;&#x6027;&#xFF0C;&#x5224;&#x65AD;&#x65F6;&#x4F1A;&#x62A5;&#x9519;&#x3002;</li>
<li>constructor&#x662F;&#x4F1A;&#x6539;&#x53D8;&#x7684;&#x5982;&#x679C;&#x6539;&#x53D8;&#x68C0;&#x6D4B;&#x4E0D;&#x51C6;&#x786E;&#x3002;</li>
</ul>
</li>
<li><p>Object.prototype.toSring.call</p>
<p>&#x5B8C;&#x7F8E;&#x5224;&#x65AD;&#x65B9;&#x6CD5;&#xFF0C;&#x53D6;&#x5F97;&#x5BF9;&#x8C61;&#x5185;&#x90E8;&#x7684;&#x5C5E;&#x6027;[[Class]]&#xFF0C;&#x6839;&#x7EDD;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x8FD4;&#x56DE;&#x7C7B;&#x4F3C;&#x4E8E;&quot;[object xxx]&quot;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x4F5C;&#x4E3A;&#x7ED3;&#x679C;&#x3002;&#x5229;&#x7528;Object.prototype.toSring&#x65B9;&#x6CD5;&#x901A;&#x8FC7;call&#x6539;&#x53D8;this&#x83B7;&#x53D6;&#x4EFB;&#x610F;&#x53D8;&#x91CF;&#x7684;&#x5185;&#x90E8;&#x5C5E;&#x6027;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-number">1</span>) <span class="hljs-comment">//=&gt; &apos;[object Number]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-string">&apos;1&apos;</span>) <span class="hljs-comment">//=&gt; &apos;[object String]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-literal">true</span>) <span class="hljs-comment">//=&gt; &apos;[object Boolean]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call([]) <span class="hljs-comment">//=&gt; &apos;[object Array]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call({}) <span class="hljs-comment">//=&gt; &apos;[object Object]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{}) <span class="hljs-comment">//=&gt; &apos;[object Function]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-literal">null</span>) <span class="hljs-comment">//=&gt; &apos;[object Null]&apos;</span>
<span class="hljs-built_in">Object</span>.prototype.toString.call(<span class="hljs-literal">undefined</span>) <span class="hljs-comment">//=&gt; &apos;[object Undefined]&apos;</span>
</code></pre>
<p>&#x200B;</p>
<p>&#x200B;</p>
</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev " aria-label="Previous page: 介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="闭包.html" class="navigation navigation-next " aria-label="Next page: 闭包">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"数据类型及判断","level":"2.1","depth":1,"next":{"title":"闭包","level":"2.2","depth":1,"path":"js基础/闭包.md","ref":"js基础/闭包.md","articles":[]},"previous":{"title":"介绍","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"js基础/数据类型及判断.md","mtime":"2022-03-09T02:42:27.703Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-03-09T09:38:49.410Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

